package com.zch.user.controller;

import com.zch.domain.Result;
import com.zch.user.service.TbDeptService;
import com.zch.user.service.TbSectionService;
import com.zch.user.vo.PageVo;
import com.zch.user.vo.TbDeptVO;
import com.zch.user.vo.TbSectionVo;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author xuebing
 * @version 1.0
 * @description: TODO
 * @date 2023/10/30 20:56
 */

@RestController
@RequestMapping("/tbUser")
@Api(tags = {"科室维护"})
public class TbUserController {
    @Autowired
    private TbDeptService tbDeptService;


    @Autowired
    private TbSectionService tbSectionService;


   
    /**
    * @description: 部门维护
    * @param: []
    * @return: com.zch.domain.Result
    * @author xuebing
    * @date: 2023/10/31 9:19
    */
    @PostMapping("/TbSectionList")
    public Result TbSectionList(@RequestBody TbSectionVo tbSectionVo, PageVo pageVo){

        return tbSectionService.TbSectionList(pageVo,tbSectionVo);
    }
    
    /**
    * @description: 根据Id进行部门修改
    * @param: [tbSectionVo]
    * @return: com.zch.domain.Result
    * @author xuebing
    * @date: 2023/10/31 9:35
    */
    @PostMapping("/TbSectionUpdate")
    public Result TbSectionUpdate(@RequestBody TbSectionVo tbSectionVo){


        return tbSectionService.TbSectionUpdate(tbSectionVo);
    }
   
    /**
    * @description: 根据Id进行删除信息
    * @param: [tbSectionVo]
    * @return: com.zch.domain.Result
    * @author xuebing
    * @date: 2023/10/31 9:36
    */
    @PostMapping("/TbSectionDelete")
    public Result TbSectionDelete(@RequestBody TbSectionVo tbSectionVo){


        return tbSectionService.TbSectionDelete(tbSectionVo);
    }

    /**
    * @description: 添加部门信息
    * @param: []
    * @return: com.zch.domain.Result
    * @author xuebing
    * @date: 2023/10/31 9:44
    */
    @PostMapping("/TbSectionSave")
    public Result TbSectionSave(@RequestBody TbSectionVo tbSectionVo){

        return tbSectionService.TbSectionSave(tbSectionVo);
    }


    /**
     * @description: 科室维护
     * @param: []
     * @return: com.zch.domain.Result
     * @author xuebing
     * @date: 2023/10/31 9:19
     */
    @PostMapping("/TbDeptList")
    public Result TbDeptList(@RequestBody TbDeptVO tbDeptVO, PageVo pageVo){

        return tbDeptService.TbDeptList(pageVo,tbDeptVO);
    }

    /**
     * @description: 根据Id进行科室修改
     * @param: [tbSectionVo]
     * @return: com.zch.domain.Result
     * @author xuebing
     * @date: 2023/10/31 9:35
     */
    @PostMapping("/TbDeptUpdate")
    public Result TbDeptUpdate(@RequestBody TbDeptVO tbDeptVO){


        return tbDeptService.TbDeptUpdate(tbDeptVO);
    }

    /**
     * @description: 根据Id进行删除信息
     * @param: [tbSectionVo]
     * @return: com.zch.domain.Result
     * @author xuebing
     * @date: 2023/10/31 9:36
     */
    @PostMapping("/TbDeptDelete")
    public Result TbDeptDelete(@RequestBody TbDeptVO tbDeptVO){


        return tbDeptService.TbDeptDelete(tbDeptVO);
    }

    /**
     * @description: 添加科室信息
     * @param: []
     * @return: com.zch.domain.Result
     * @author xuebing
     * @date: 2023/10/31 9:44
     */
    @PostMapping("/TbDeptSave")
    public Result TbDeptSave(@RequestBody TbDeptVO tbDeptVO){

        return tbDeptService.TbDeptSave(tbDeptVO);
    }



}
